<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="java.util.List"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
     <html>
            <head>
            	<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
            	<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
            	<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <script>
                $(function(){
                    //得到当前时间
                    var date_now = new Date();
                    //得到当前年份
                    var year = date_now.getFullYear();
                    //得到当前月份
                    //注：
                    //  1：js中获取Date中的month时，会比当前月份少一个月，所以这里需要先加一
                    //  2: 判断当前月份是否小于10，如果小于，那么就在月份的前面加一个 '0' ， 如果大于，就显示当前月份
                    var month = date_now.getMonth()+1 < 10 ? "0"+(date_now.getMonth()+1) : (date_now.getMonth()+1);
                    //得到当前日子（多少号）
                    var date = date_now.getDate() < 10 ? "0"+date_now.getDate() : date_now.getDate();
                    //设置input标签的max属性
                    $("#beginTime").attr("min",year+"-"+month+"-"+date);
                    $("#endTime").attr("min",year+"-"+month+"-"+date);
                })
            </script>
            <title>产品购买页面</title>
            </head>
            <body>
<nav class="navbar navbar-default" role="navigation">
	<div class="container-fluid">
	<div class="navbar-header">
		<a class="navbar-brand" href="#">旅游网站</a>
	</div>
	<div>
		<ul class="nav navbar-nav">
			<li><a href="searchAllProducts">旅游产品</a></li>
			<li class="dropdown">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown">
					用户区
					<b class="caret"></b>
				</a>
				<ul class="dropdown-menu">
					<li><a href="toAddC">用户发帖</a></li>
					<li><a href="selectAllComment">用户帖子区</a></li>
				</ul>
			</li>
            <li><a href="initS">天气查询</a></li>
		</ul>
        <ul class="nav navbar-nav navbar-right">
            <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">用户中心
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
					<li><a href="touUpdate">修改用户信息</a></li>
					<li><a href="selectMyCart">查看用户购物车</a></li>
                    <li><a href="selectMyOrderList">查看用户订单</a></li>
				</ul>
            </li>
            <li><a href="ulogOut"><span class="glyphicon glyphicon-log-out"></span> 登出</a></li>
        </ul>
	</div>
	</div>
</nav>
<br>
<h3>订购详情</h3>
<form role="form" action="${pageContext.request.contextPath}/toCart" method="post">
    <c:forEach items="${p}" var="item">
<div class="form-group">
    <div class="col-lg-2">
        <label for="name">产品图片:</label>
        <img style="width:150px;height:150px" src="${item.pimg}">
        <br>
        <label for="name">产品编号：</label>
		<input type="text" class="form-control" name="pid"
			   required="required" readonly="readonly" value="${item.pid}">

    <label for="name">产品名字：</label>
		<input type="text" class="form-control" name="pname"
			   required="required" readonly="readonly" value="${item.pname}">

    <label for="name">产品位置：</label>
		<input type="text" class="form-control" name="ploct"
			   required="required" readonly="readonly" value="${item.ploct}">

    <label for="name">产品数量：</label>
		<input type="text" class="form-control" name="pcount"
			   placeholder="请输入产品数量" required="required" value=1>

    <label for="name">产品价格：</label>
        <input type="text" class="form-control" name="pprice"
                required="required" readonly="readonly" value="${item.pprice}">

    <label for="name">开始日期：</label>
        <input type="date" class="form-control" name="startdate"
                required="required" id="beginTime">

    <label for="name">结束日期：</label>
        <input type="date" class="form-control" name="enddate"
                required="required" id="endTime">

    <br>
    <button type="submit" class="btn btn-default">订购</button>
    <button type="reset" class="btn btn-default">重置</button>
    </div>
</div>
</c:forEach>
</form>
            </body>
     </html>